<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <button @click="setSession">1</button>
        <button @click="getSession">2</button>
    </div>
    <script src="../../vue.js"></script>
    <script src="../../axios.min.js"></script>


    <script>
        const app = new Vue({
            el:"#app",
            methods: {
                async setSession() {
                    const res = await axios({
                        url:"http://127.0.0.1:8080/test/set",
                        method: 'GET', // 虽然 GET 是默认方法，但明确指定是个好习惯  
                        withCredentials: true, // 如果需要发送 Cookie，请启用此选项
                    });
                    console.log(res);
                },
                async getSession() {
                    const res = await axios({
                        url:"http://127.0.0.1:8080/test/get",
                    });
                    console.log(res);
                }
            },
        })
    </script>
</body>
</html>